package com.cloudkinto.service.order.outbound;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.wave.*;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderOutboundDo;
import com.cloudkinto.entity.OutboundWaveDo;
import com.cloudkinto.vo.order.outbound.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 出库波次 service接口
 * </p>
 *
 * @author long
 * @since 2024-12-03
 */
public interface OutboundWaveService extends IService<OutboundWaveDo> {

    WaveDetail detail(Long id);

    SingleResult pageInit(Long userId, Long tenantId, String source);

    PageResult getListPage(WaveQueryBo bo);

    SingleResult listPageStatusStatistics(WaveQueryBo bo);

    int cannelWave(Long id, Long userId, String username);

    void assignPickers(List<Long> ids, Long pickerId);

    WavePickingDetail wavePickingDetail(Long id);

    boolean wavePickingOperate(WavePickingBo bo, Long userId, String username, Long tenantId);

    /**
     * 波次拣货完成后的状态变更
     */
    void wavePickingFinishHandler(Long waveId, Long userId, String username, String operateKey, List<OrderOutboundDo> outboundDoList);

    void getSecondarySortingPreJudge(String waveNo);

    WaveSecondarySortingDetail getSecondarySortingDetail(SecondarySortingQueryBo bo, Long whId);

    SecondarySortingOperateVo secondarySortingOperate(WaveSecondarySortingBo bo, Long userId, String username, Long whId);

    void secondarySortingClearRedo(WaveSecondarySortingClearBo bo, Long userId, String username);

    void secondarySortingForceFinish(WaveSecondarySortingForceFinishBo bo, Long userId, String username);

    WaveRecheckDetail getRecheckDetail(String scan, Boolean whetherCheck, Long whId);

    RecheckOperateVo recheck(RecheckBo bo, Long userId, String username);

    void recheckClearRedo(RecheckClearRedoBo bo, Long userId, String username);

    void printWavePickingListByClassify(Long id, HttpServletResponse response) throws IOException;

    void printWavePickingListByTotal(Long id, HttpServletResponse response) throws IOException;

    void waveForceFinish(Long waveId, Long userId, String username);
}
